﻿using System.Web.Routing;
using WebDotNet.HttpHandlers;
using WebDotNet.Samples.DefaultMvcApplication.Handlers.Account;
using WebDotNet.Samples.DefaultMvcApplication.Handlers.Home;

namespace WebDotNet.Samples.DefaultMvcApplication
{
	// Note: For instructions on enabling IIS6 or IIS7 classic mode, 
	// visit http://go.microsoft.com/?LinkId=9394801

	public class MvcApplication : System.Web.HttpApplication
	{
		public static void RegisterRoutes(RouteCollection routes)
		{
			RequestHandler.RegisterUrlHandler("", typeof(Index));
			RequestHandler.RegisterUrlHandler("Home/Index", typeof(Index));
			RequestHandler.RegisterUrlHandler("Home/About", typeof(About));
			RequestHandler.RegisterUrlHandler("Account/LogOn", typeof(LogOn));
			RequestHandler.RegisterUrlHandler("Account/LogOff", typeof(LogOff));
			RequestHandler.RegisterUrlHandler("Account/Register", typeof(Register));
			RequestHandler.RegisterUrlHandler("Account/ChangePassword", typeof(ChangePassword));
			RequestHandler.RegisterUrlHandler("Account/ChangePasswordSuccess", typeof(ChangePasswordSuccess));
		}

		protected void Application_Start()
		{
			RegisterRoutes(RouteTable.Routes);
		}
	}
}